<template>
  <div class="tpl44-exhibit">
    <section class="style53_exhibit exhibit_group">
      <ul>
        <li
          :key="index"
          :class="index > 2 ? 'fixation': ''"
          v-for="(item, index) in tplItemData.dataset">
          <a @click="openPage(item.link)">
            <div class="img_box"><img :src="item.pic"/></div>
            <p class="tit">{{ item.showtitle }}</p>
            <span v-if="item.tip" class="act_tip">{{ item.tip }}</span>
          </a>
        </li>
      </ul>
    </section>
  </div>
</template>

<script>
import Vue from 'vue'
import { openPage } from '@/utils/utils'
export default Vue.extend({
  props: {
    tplItemData: {
      type: Object // 传入参数的类型
    }
  },
  methods: {
    // TODO 小程序跳转
    openPage(link) {
      // console.log('link',link)
      openPage(link)
    }
  },
})
</script>

<style lang="scss">
@import "src/styles/mixin";
.tpl44-exhibit{
  .exhibit_group{
    overflow-x: scroll;
    padding: 10px 10px 10px 0;
    ul{
      display: inline-flex;
      display:-webkit-inline-box;
      display:-webkit-inline-flex;
      flex-wrap: nowrap;
      -webkit-flex-wrap: nowrap;
      -moz-flex-wrap: nowrap;
      li{
        width: 31.7%;
        min-width: 31.7%;
        position: relative;
        background: #fff;
        margin-left: 10px;
        padding-bottom: 16px;
        &.fixation{
          width: 234px;
          min-width: 234px;
        }
        .img_box{
          padding: 0 6px;
          overflow: hidden;
          img{
            width: 100%;
          }
        }
        .tit{
          color: #333;
          font-size: 24px;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
          text-align: center;
        }
        .act_tip{
          position: absolute;
          left: 0;
          top: 0;
          color: #fff;
          height: 80px;
          width: 68px;
          line-height: 28px;
          letter-spacing: 2px;
          text-align: center;
          padding-top: 4px;
        }
        &:nth-of-type(3n+1){
          .act_tip{
            background: url(https://img.wifenxiao.com/h5-wfx/images/diy/tpl44/53tip_color1.png) no-repeat;
            background-size: contain;
          }
        }
        &:nth-of-type(3n+2){
          .act_tip{
            background: url(https://img.wifenxiao.com/h5-wfx/images/diy/tpl44/53tip_color2.png) no-repeat;
            background-size: contain;
          }
        }
        &:nth-of-type(3n+3){
          .act_tip{
            background: url(https://img.wifenxiao.com/h5-wfx/images/diy/tpl44/53tip_color3.png) no-repeat;
            background-size: contain;
          }
        }
      }
    }
    
  }
}
</style>
